package Com.aop.demo;

import com.mchange.v2.c3p0.ComboPooledDataSource;
import org.junit.Test;
import org.springframework.jdbc.core.JdbcTemplate;

import java.beans.PropertyVetoException;

public class TexgtSpringJDBC {
    @Test
    public void show() throws PropertyVetoException {
        ComboPooledDataSource pool=new ComboPooledDataSource();
        pool.setDriverClass("com.mysql.jdbc.Driver");
        pool.setJdbcUrl("jdbc:mysql://localhost:3306/myschool");
        pool.setUser("root");
        pool.setPassword("123456");
        JdbcTemplate jt=new JdbcTemplate();
        jt.setDataSource(pool);
        String sql="delete from student where studentNo=20010";
        int update = jt.update(sql);
        System.out.println(update);
    }
}
